﻿using System;
using KillBill.Business.Entities;
using KillBill.Common.View;
using KillBill.Presentation.Modules.Products.IView;
using KillBill.Presentation.Modules.Products.ProductsServiceReference;
using KillBill.Presentation.Modules.Administration;
namespace KillBill.Presentation.Modules.Products.Presenter
{
    public class ProductFindPresenter
    {
        //Service
        private ProductsServiceClient _productsService = new ProductsServiceClient();
        
        public IProductFind View { get; set; }
        public ProductFindPresenter(IProductFind view)
        {
            View = view;
           
        }
        public void GetProducts()
        {
            try
            {
                var products = _productsService.GetProductList(View.ProductID.ToString());
                if (products.Success == true)
                {
                    View.ProductID = products.Products;
                }
                else
                    if (products.Messages.Count > 0)
                    {
                    }

            }
            catch (Exception)
            {
            }
        }
    }
}
